<!--
  ~
  ~   Copyright 2016 Walmart Technology
  ~
  ~   Licensed under the Apache License, Version 2.0 (the "License");
  ~   you may not use this file except in compliance with the License.
  ~   You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~   Unless required by applicable law or agreed to in writing, software
  ~   distributed under the License is distributed on an "AS IS" BASIS,
  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~   See the License for the specific language governing permissions and
  ~   limitations under the License.
  ~
  -->

<fieldset disabled>
    <div class="form-group">
        <p> Pending Count: {{pendingCount}}</p>
    </div>

    <div class="form-group">
        <p> In Progress Count: {{inProgressCount}}</p>
    </div>
    <div class="form-group" ng-show="inProgressCount>0">
        <p> Job In Progress <img src="/spinner.gif"></p>
    </div>
    <div class="form-group" ng-show="pendingCount>0 && inProgressCount==0">
        <p> No Worker Available</p>
    </div>
    <div class="form-group" ng-show="cancelled==true">
        <p> Cancelled:  {{cancelled}}</p>
    </div>
    <div class="form-group" ng-show="pendingCount==0 && inProgressCount==0">
        <p> Job Completed</p><a ng-href="#/report/{{trackingId}}">View Report</a>
    </div>
</fieldset>

<div class="alert alert-info" role="alert" >
    COMPLETED TASKS:
</div>
<div class="table-responsive">

    <table class="table">
        <thead>
        <tr>
            <th>ERROR</th>
            <th>STD</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="work in completed">
            <td> <a ng-href="{{work.errorLog}}"> Error Log</a> <p>{{work.errorLog}}</p> </td>
            <td><a ng-href="{{work.stdLog}}"> Std Log</a><p>{{work.stdLog}}</p></td>
        </tr>
        </tbody>
    </table>
</div>

<div class="alert alert-info" role="alert" >
  FAILED TASKS:
</div>

<div class="table-responsive">

    <table class="table">
        <thead>
        <tr>
            <th>ERROR</th>
            <th>STD</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="work in failed">
            <td> <a ng-href="{{work.errorLog}}"> Error Log</a> <p>{{work.errorLog}}</p> </td>
            <td><a ng-href="{{work.stdLog}}"> Std Log</a><p>{{work.stdLog}}</p></td>
        </tr>
        </tbody>
    </table>
</div>

<div class="alert alert-info" role="alert" ></div>

<div class="form-group" ng-show="cancelled==false">
    <button name="cancel" class="btn btn-primary" ng-click="cancelJob()">Cancel</button>
</div>